import request from "@/utils/request";
import store from "@/store";
export const service = () => {
  return !!store.getters.userInfo.tenantId ? "/event" : "/ttevent";
};
export function getTagsByAlarmType(typeValue) {
  return request({
    url: "/event/alarm/tag/getTagsByAlarmType/" + typeValue,
    method: "get",
  });
}

export function getTagsByAlarmTypeTower(data) {
  return request({
    url: "/ttevent/alarm/type/getTagsByAlarmType",
    method: "post",
    data,
  });
}

export function deleteTag(data) {
  return request({
    url: "/event/alarm/tag/deleteTag",
    method: "post",
    data,
  });
}

export function modifyTag(data) {
  return request({
    url: "/event/alarm/tag/modifyTag",
    method: "post",
    data,
  });
}

export function addTag(data) {
  return request({
    url: "/event/alarm/tag/addTag",
    method: "post",
    data,
  });
}

export function getAllTags(query) {
  return request({
    url: "/event/alarm/tag/getAllTags",
    method: "get",
    query,
  });
}

export function getVisibleTags(query) {
  return request({
    url: "/event/alarm/tag/getVisibleTags",
    method: "get",
    query,
  });
}

export function saveTagRelation(data) {
  return request({
    url: "/event/alarm/tag/saveTagRelation",
    method: "post",
    data,
  });
}

export function findReasonList(data) {
  return request({
    url: service() + "/alarm/reason/list",
    method: "post",
    data,
  });
}

export function saveReasonList(data) {
  return request({
    url: "/event/alarm/reason/save",
    method: "post",
    data,
  });
}
